package com.jida.tijian.controller;

import com.jida.tijian.dto.OrderListRequestDto;
import com.jida.tijian.dto.ResponseObject;
import com.jida.tijian.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrdersController {
    @Autowired
    OrderService orderService;

    @RequestMapping("/ordersList")//配路由
    public ResponseObject ordersList(@RequestBody OrderListRequestDto orderListRequestDto){
//        System.out.println(orderListRequestDto.getSex() + " " + orderListRequestDto.getRealName() + " " + orderListRequestDto.getState());
        System.out.println(
                "userId: " + orderListRequestDto.getUserId() + " | " +
                        "orderData: " + orderListRequestDto.getOrderDate() + " | " +
                        "smId: " + orderListRequestDto.getSmId() + " | " +
                        "sex: " + orderListRequestDto.getSex() + " | " +
                        "state: " + orderListRequestDto.getState() + " | " +
                        "hpId: " + orderListRequestDto.getHpId() + " | " +
                        "realName: " + orderListRequestDto.getRealName()
        );
        return orderService.ordersList(orderListRequestDto);
    }
}
